import request from '@/utils/request'

// 查询学生获奖信息列表
export function listAward(query) {
  return request({
    url: '/result/awardStudent/list',
    method: 'get',
    params: query
  })
}
/**
 * 根据多个id批量查询学生获奖信息列表
 */
export function getAwardStudentByIds(ids) {
  return request({
    url: `/result/awardStudent/getAwardStudentByIds`,
    method: 'get',
    params: { ids: ids.join(',') } // 将数组转换为逗号分隔的字符串
  });
}
// 查询学生获奖信息详细
export function getAward(id) {
  return request({
    url: '/result/awardStudent/' + id,
    method: 'get'
  })
}
/**
 * 根据id来查询学生获奖信息
 */
export function getStudentAwardById(id) {
  return request({
    url: '/result/awardStudent/' + id,
    method: 'get'
  })
}

// 新增学生获奖信息
export function addAward(data) {
  return request({
    url: '/result/awardStudent',
    method: 'post',
    data: data
  })
}

// 修改学生获奖信息
export function updateAward(data) {
  return request({
    url: '/result/awardStudent',
    method: 'put',
    data: data
  })
}

// 删除学生获奖信息
export function delAward(id) {
  return request({
    url: '/result/awardStudent/' + id,
    method: 'delete'
  })
}
/**
 * 批量导出学生获奖信息
 */
export function exportAwardStudent(params) {
  return request.post(`/result/awardStudent/export/awardStudent`, params, {
    responseType: 'blob'
  });
}
